<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core" 
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">

    <h:head>
        <title>Sunrise Calendar</title>
        <h:outputStylesheet library="css" name="main.css"  />
    </h:head>
    <h:body>
        <div id="container">
            <ui:include src="logo.xhtml" />
            <div id="login">
                <h:form id="loginForm">
                    <p:panel>
                        <h:panelGrid columns="2" cellpadding="5">
                            <p:outputLabel for="email" value="Email"/>
                            <p:inputText id="email" value="#{loginBean.email}" 
                                         required="true"
                                         requiredMessage="Email cannot be empty"/>
                            <p:outputLabel for="password" value="Password"/>
                            <p:password id="password" value="#{loginBean.password}" 
                                        required="true"
                                        requiredMessage="Password cannot be empty"/>

                            <f:facet name="footer">
                                <p:button  value="Register" outcome="register"/>
                                <p:spacer width="120" height="0" />
                                <p:commandButton value="Login" 
                                                 action="#{loginBean.login()}" styleClass="ui-priority-primary"
                                                 ajax="true" update="@all"/>
                            </f:facet>
                        </h:panelGrid>
                        <h:messages  style="color: red"/>
                    </p:panel>
                </h:form>
            </div>
        </div>
    </h:body>
</html>

